#!/bin/bash

data=("mushroom" "retail" "T10I4D100K")
mushroom=(0.25 0.20 0.15 0.10 0.05)
retail=(0.60 0.55 0.50 0.45 0.40)
T10I4D100K=(0.005 0.004 0.003 0.002 0.001)

DATADIR=./data
ANSWERDIR=./answer

PROG=fpgrowth
FREQ=./${PROG}/${PROG}

if ! [ -e ${ANSWERDIR} ]
then
  mkdir ${ANSWERDIR}
fi

for i in ${data[@]}
do
  for j in $(eval echo \${${i}[@]})
  do
    echo -n "${i}.dat"$'\t'"($j)"$'\t'
    ${FREQ} ${j} <${DATADIR}/${i}.dat >${ANSWERDIR}/${i}\(${j}\).ans
    echo "Done"
  done
done
